import request from '@/config/axios'

export function loadOneStepApi(data: LoadOneStepRequest) {
	return request.post<LoadOneStepVo[]>({
		url: '/game/g-production-line/readOnly/loadOneStep',
		data
	})
}

export function saveUserProductionApi(data: SaveUserProductionRequest) {
	return request.post({
		url: '/game/g-user-production/saveUserProduction',
		data
	})
}

export function deleteUserProductionApi(id: number) {
	return request.delete({
		url: '/game/g-user-production/deleteUserProduction/' + id
	})
}

export function getAllItemApi() {
	return request.get<GItem[]>({
		url: '/game/g-user-production/readOnly/getAllItem',
	})
}

export function getAllUserApi() {
	return request.get<SysUser[]>({
		url: '/game/g-user-production/readOnly/getAllUser'
	})
}

export function modifyProductionNameApi(data: ModifyProductionNameRequest) {
	return request.post<string | undefined>({
		url: '/game/g-user-production/modifyProductionName',
		data
	})
}

export function getUserProductionByIdApi(id: number) {
	return request.post<GUserProduction>({
		url: '/game/g-user-production/readOnly/getUserProductionById/' + id
	})
}

export function generateProductionNameApi(data: GenerateProductionNameRequest) {
	return request.post<string>({
		url: '/game/g-user-production/readOnly/generateProductionName',
		data
	})
}
